package cn.edu.zut.score.core.convert;

import cn.edu.zut.score.core.dto.response.ClazzResponse;
import cn.edu.zut.score.core.entity.Clazz;
import cn.edu.zut.score.core.entity.Info;
import io.swagger.annotations.ApiModel;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @author zby
 * @date 2021/06/27
 */
@ApiModel("班级相关转换器")
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE, nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface ClazzConvert {

    ClazzConvert INSTANCE = Mappers.getMapper(ClazzConvert.class);

    ClazzResponse clazz2Response(Clazz clazz);

    List<ClazzResponse> clazzs2Responses(List<Clazz> clazzes);

    List<Info> clazzs2Infos(List<Clazz> clazzes);
}
